//
//  CustomPinAnnotationView.m
//  PigMarket
//
//  Created by 张敬 on 2019/8/30.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "CustomPinAnnotationView.h"

@implementation CustomPinAnnotationView

- (instancetype)initWithAnnotation:(id<MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self addSubview:self.icon];
    }
    return self;
}

- (void)setImageUrl:(NSString *)imageUrl{
    
    [_icon sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageNamed:@"head_blank_mine"]];
}


- (UIImageView *)icon{
    
    if (!_icon) {
        _icon = [[UIImageView alloc] init];
        _icon.frame = CGRectMake(4, 2, 26, 26);
        _icon.image = [UIImage imageNamed:@"head_blank_mine"];
        [self addShadowAndCircleCorner:_icon.layer corner:13];
    }
    return _icon;
}


@end
